<!DOCTYPE html>
<html>
<head id="Head1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, user-scalable=no, maximum-scale=1.0" />
<title>最新揭晓</title>
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="black" name="apple-mobile-web-app-status-bar-style" />
<meta content="telephone=no" name="format-detection" />
<link href="../assets/mobile/comm.css" rel="stylesheet" type="text/css" />
<link href="../assets/mobile/lottery.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="../assets/mobile/top.css">
<script src="../assets/js/mobile/jquery190.js" type="text/javascript"></script>
<link rel="stylesheet" href="../assets/agile/css/ratchet/css/ratchet.min.css">
<link rel="stylesheet" href="../assets/agile/css/flat/flat.component.css">
<link rel="stylesheet" href="../assets/agile/css/flat/flat.color.css">
<link rel="stylesheet" href="../assets/agile/css/flat/iconline.css">
<link rel="stylesheet" href="../assets/app/css/app.css" />
<style type="text/css">
#divLottery .revConL img{border-radius: 4px;}
</style>
</head>
<body style="background:#fff;position:static;">
<div id="ios-top-box">
	<div id="header" class="bar bar-nav">
	<div class="titlebar">
	<a href="javascript:appClose('teamlottery',api);" style="margin-left:5px;"><i class="iconfont iconline-arrow-left"></i></a>
	<h1 class="title">组团揭晓</h1>
	
	</div>
	</div>
</div>
<div class="h5-1yyg-v1" id="loadingPicBlock">
    <div id="wrapper" style="background:#fff;margin-top:64px;">
    <section class="revealed" style="background:#fff;margin-top:0px !important;margin-bottom:0px !important;">
        <div id="divLottery" class="revCon" style="background:#fff;">
            <div class="h"></div>
            <div id="divLotteryLoading" class="loading"><b class="loading-img"></b>正在加载</div>
            <a id="btnLoadMore" class="loading" href="javascript:;" style="display:none;">点击加载更多</a>
           
        </div>
    </section>
    </div>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/config.js"></script>
<script type="text/javascript" src="../script/local.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
<script type="text/javascript" src="../assets/js/mobile/BottomFun.js"></script>
</div>
<style>
    .revCon ul{
        height:auto;
    }
#wrapper{
    position:static !important;
    z-index:1;
    left:0;
    width:100%;
    top:0px  !important;
    bottom:0px  !important;
    overflow:auto  !important;
}
</style>
<script type="text/javascript" charset="utf-8">

//打开已揭晓商品页面
function openDataserver(goods_id){
	if(!goods_id) api.alert({'msg':'参数错误'});
	localData.set('dataserver_goods_id',goods_id);
	api.openWin({
		name:'dataserver',
		url:'./dataserver.html',
		reload:true
	});
}
//访问用户首页
function openUserindex(userid){
	if(!userid) api.alert({'msg':'参数错误'});
	localData.set('userid',userid);
	api.openWin({
		name:'userindex',
		url:'./userindex.html',
		reload:true
	});
}

apiready = function(){
	if(api.connectionType == 'none'){
		api.showProgress({
		     title : '未连接网络',
		     text : ''
		 });
		return false;
	}else{
		setTimeout(function(){
			api.hideProgress();
		},15000);
	}
	/*
	api.showProgress({'title':'加载中','text':''});
	setTimeout(function(){
		api.hideProgress();
	},30000);
	*/
	var page = {
		page:1,
		totalPage:0,
	};
	GetJPData(config.url+'/app.php?act=tlottery&page=1',{test:true},function(data){
		//api.hideProgress();   
		if(data['code'] == 0){
		       var html = '';
		       for(var i=0; i < data['listItems'].length; i++){
		            html += '<ul id="'+data['listItems'][i]['id']+'">';
		                html += ' <li class="revConL">';
		                 html += '<a href="javascript:iow('+data['listItems'][i]['id']+');">';
		                 html += '<img class="lazy" data-original="'+config.upload_url+'/'+data['listItems'][i]['thumb']+'">';
		                 html += '</a></li> <li class="revConR"><dl><dd>';
		                  html +='<a href="javascript:openUserindex('+data['listItems'][i]['q_uid']+');">';
		             html += '<img name="uImg" uweb="'+data['listItems'][i]['q_uid']+'" class="lazy" data-original="'+config.upload_url+'/'+data['listItems'][i]['userphoto']+'">';
		                    html += ' </a></dd><dd>';
		                   html += '<span>获得者<strong>：</strong><a name="uName" href="javascript:openUserindex('+data['listItems'][i]['q_uid']+');" uweb="'+data['listItems'][i]['q_uid']+'" class="rUserName blue">'+data['listItems'][i]['q_user']+'</a></span>本期抢购<strong>：</strong>';
		                   html += '<em class="orange arial">'+data['listItems'][i]['gonumber']+'</em>人次</dd></dl>';
		                  html += '<dt>团名称：<em class="orange arial">'+data['listItems'][i]['q_group_name']+'</em><br />幸运抢购码：<em class="orange arial">'+data['listItems'][i]['q_user_code']+'</em><br>揭晓时间：<em class="c9 arial">'+data['listItems'][i]['q_end_time']+'</em>';
		             html += '</dt><b class="fr z-arrow"><a style="position:absolute;right:-6px;top:-6px;width:18px;height:18px;display:block;" href="javascript:iow('+data['listItems'][i]['id']+');"></a></b></li></ul>';
		       }
		       $('.h').html(html);
		       lyzimg();
			   page.totalPage = data['totalPage'];
			   $('#btnLoadMore').show();
		       $('#divLotteryLoading').hide();
		   }
		});
	$('#btnLoadMore').click(function(){
		var p = page.page++;
		if(p > page.totalPage) {
			$('#btnLoadMore').hide();
		return false;};
					   $('#btnLoadMore').hide();
		       $('#divLotteryLoading').show();
	GetJPData(config.url+'/app.php?act=tlottery&page='+p,{test:true},function(data){
		//api.hideProgress();   
		if(data['code'] == 0){
		       var html = '';
		       for(var i=0; i < data['listItems'].length; i++){
		            html += '<ul id="'+data['listItems'][i]['id']+'">';
		                html += ' <li class="revConL">';
		                 html += '<a href="javascript:iow('+data['listItems'][i]['id']+');">';
		                 html += '<img class="lazy'+p+'" data-original="'+config.upload_url+'/'+data['listItems'][i]['thumb']+'">';
		                 html += '</a></li> <li class="revConR"><dl><dd>';
		                  html +='<a href="javascript:openUserindex('+data['listItems'][i]['q_uid']+');">';
		             html += '<img name="uImg" uweb="'+data['listItems'][i]['q_uid']+'" class="lazy'+p+'" data-original="'+config.upload_url+'/'+data['listItems'][i]['userphoto']+'">';
		                    html += ' </a></dd><dd>';
		                   html += '<span>获得者<strong>：</strong><a name="uName" href="javascript:openUserindex('+data['listItems'][i]['q_uid']+');" uweb="'+data['listItems'][i]['q_uid']+'" class="rUserName blue">'+data['listItems'][i]['q_user']+'</a></span>本期抢购<strong>：</strong>';
		                   html += '<em class="orange arial">'+data['listItems'][i]['gonumber']+'</em>人次</dd></dl>';
		                  html += '<dt>团名称：<em class="orange arial">'+data['listItems'][i]['q_group_name']+'</em><br />幸运抢购码：<em class="orange arial">'+data['listItems'][i]['q_user_code']+'</em><br>揭晓时间：<em class="c9 arial">'+data['listItems'][i]['q_end_time']+'</em>';
		             html += '</dt><b class="fr z-arrow"><a style="position:absolute;right:-6px;top:-6px;width:18px;height:18px;display:block;" href="javascript:iow('+data['listItems'][i]['id']+');"></a></b></li></ul>';
		       }
		       $('.h').append(html);
		       $("img.lazy"+p).lazyload({effect: "fadeIn"});
			   page.totalPage = data['totalPage'];
			   if(data['totalPage'] != p){
			   		$('#btnLoadMore').show();
			   }else{
			   	$('#btnLoadMore').hide();
			   }
		       $('#divLotteryLoading').hide();
		   }
		});
	});
/**
 * 	setTimeout(function(){
        api.setRefreshHeaderInfo({
            visible: true,
            loadingImg: 'widget://image/refresh.png',
            bgColor: '#fff',
            textColor: '#333',
            textDown: '下拉刷新...',
            textUp: '松开刷新...',
            showTime: true
        },function(ret, err ){
			setTimeout(function(){
				api.refreshHeaderLoadDone();
			},15000);
            GetJPData(config.url+'/app.php?act=lottery',{test:true},function(data){
if(data['code'] == 0){
       var html = '';
       for(var i=0; i < data['listItems'].length; i++){
            html += '<ul id="'+data['listItems'][i]['id']+'">';
                html += ' <li class="revConL">';
                 html += '<a href="javascript:iow('+data['listItems'][i]['id']+');">';
                 html += '<img class="lazy" data-original="'+config.upload_url+'/'+data['listItems'][i]['thumb']+'">';
                 html += '</a></li> <li class="revConR"><dl><dd>';
                  html +='<a href="javascript:openUserindex('+data['listItems'][i]['q_uid']+');">';
             html += '<img name="uImg" uweb="'+data['listItems'][i]['q_uid']+'" class="lazy" data-original="'+config.upload_url+'/'+data['listItems'][i]['userphoto']+'">';
                    html += ' </a></dd><dd>';
                   html += '<span>获得者<strong>：</strong><a name="uName" href="javascript:openUserindex('+data['listItems'][i]['q_uid']+');" uweb="'+data['listItems'][i]['q_uid']+'" class="rUserName blue">'+data['listItems'][i]['q_user']+'</a></span>本期抢购<strong>：</strong>';
                   html += '<em class="orange arial">'+data['listItems'][i]['gonumber']+'</em>人次</dd></dl>';
                  html += '<dt>幸运抢购码：<em class="orange arial">'+data['listItems'][i]['q_user_code']+'</em><br>揭晓时间：<em class="c9 arial">'+data['listItems'][i]['q_end_time']+'</em>';
             html += '</dt><b class="fr z-arrow"><a style="position:absolute;right:-6px;top:-6px;width:18px;height:18px;display:block;" href="javascript:openDataserver('+data['listItems'][i]['id']+');"></a></b></li></ul>';
       }
          $('.h').html(html);
           lyzimg();
           api.refreshHeaderLoadDone();
       }else{
           api.refreshHeaderLoadDone();
       }
            });
            
       });
	},500);
 */
};
function iow(id){
	localData.set('team_goods_id',id);
	api.openWin({name:'js_result','url':'./js_result.html',reload:true});
}
</script>
</body>
</html>